<!-- 登录页面 -->
<template>
  <div class="flex flex-col h-screen">
    <template v-if="currentPane === 'login'">
      <LoginPane @togglePane="togglePane"></LoginPane>
    </template>
    <template v-if="currentPane=='register'">
      <RegisterPane @togglePane="togglePane"></RegisterPane>
    </template>
    <template v-if="currentPane=='success'">
      <SuccessPane @togglePane="togglePane" :registerInfo="registerInfo"></SuccessPane>
    </template>
  </div>
</template>

<script setup lang="ts">
import {ref} from "vue";
import 'element-plus/es/components/message/style/css';
import LoginPane from "@/views/login_components/LoginPane.vue";
import RegisterPane from "@/views/login_components/RegisterPane.vue";
import SuccessPane from "@/views/login_components/SuccessPane.vue";

/*标记当前的pane*/
let currentPane = ref<string>("login");

const registerInfo = ref({
  account: '',
  contact: '',
})

const togglePane = (label: string, info: any) => {
  currentPane.value = label
  if (info) {
    registerInfo.value.account = info.account
    registerInfo.value.contact = info.contact
  }
}

</script>
<style scoped>

</style>